<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-md-6">
        <h2>商品管理</h2>
        <ol class="breadcrumb">
            <li>
                <a href="index.html">主页</a>
            </li>
            
            <li class="active">
                <strong>商品管理</strong>
            </li>
        </ol>
    </div>
    <div class="col-md-6">
        <h2><a href="{:U('admin/product/add')}" class="btn btn-success btn-lg pull-right">商品添加</a></h2>
    </div>
    
</div>
<div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-md-12">
                    <div class="">
                 <table class="table">
                    <thead>
                    <tr>
                        <th>id</th>
                        <th>商品名称</th>
                        <th>分类</th>
                        <th>价格</th>
                        <th>库存</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="products" id="vo">
                        <tr>
                            <td>{$vo.id}</td>
                            <td>
                                <img style="height:50px;" src="__ROOT__{$vo.img}">
                                <a href=""> {$vo.title}</a>
                            </td>
                            <td>{$vo.name}</td>
                            <td>￥{$vo.price}</td>
                            <td>{$vo.stock}</td>
                            <td>{$vo.status|product_status}</td>
                            <td><if condition="$vo['status'] eq 1">
                                 <a href="{:U('admin/product/ban/id/'.$vo['id'])}" class="btn btn-warning btn-xs">下架</a>
                                 <else />
                                 <a href="{:U('admin/product/enable/id/'.$vo['id'])}" class="btn btn-success btn-xs">上架</a></if>
                                <a href="{:U('admin/product/edit/id/'.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a>
                                <a href="{:U('admin/product/delete/id/'.$vo['id'])}" class="btn btn-danger btn-xs delete">删除</a>
                            </td>
                        </tr>
                    </volist>
                    </tbody>
                </table> 
                {$page} 
            </div>
        </div>
    </div>                 
</div>

